from flask import Blueprint, current_app

from flask_restful import Resource

from common import Result
from xtoad.auth import auth

demo_bp = Blueprint('demo', __name__)


class DemoApi(Resource):
    def get(self):
        current_app.logger.info('hello Demo logging')
        return Result.success(data={'get': 'hello xtoad'})

    def post(self):
        return Result.success({'post': 'post hello xtoad'})

    def put(self):
        return Result.success({'put': 'put xtoad'})

    @auth.login_required
    def delete(self):
        return Result.success()




